import type { postOrPutType } from "@/constants";
import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
/* 注册店铺 地址 */
const url = "/back/store-apply";
/* 获取注册店铺列表信息 */
export const getStoreApplyInfo = <T, D>(params: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/*注册店铺：通过id获取注册店铺详情信息 */
export const getStoreApplyByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 注册店铺  修改注册店铺信息 */
export const commonStoreApplyInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
